package com.dailyblue.java.spring.jwt.config;

import com.dailyblue.java.spring.jwt.interceptor.IsLoginInterceptor;
import com.dailyblue.java.spring.jwt.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;

@Configuration
public class SpringMVCConfig extends WebMvcConfigurerAdapter {
    @Resource
    private LoginInterceptor loginInterceptor;
    @Resource
    private IsLoginInterceptor isLoginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/emp/login");
        /*registry.addInterceptor(isLoginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/emp/login","/emp/registry");*/
    }
}
